import requests


headers = {
    "Accept": "application/json, text/plain, */*",
    "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
    "Connection": "keep-alive",
    "Origin": "https://www.qimai.cn",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-site",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0",
    "sec-ch-ua": "\"Microsoft Edge\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\""
}
cookies = {
    "synct": "1762431516.454",
    "syncd": "-17662",
    "PHPSESSID": "cekmhd2d2jfnos07nfl7mfemkl",
    "qm_check": "A1sdRUIQChtxen8pI0dAOTQ+GRdzfX0QZlkBAwgGUC03HBcFCAl9FBBVHldYSElLDAcCGRl0XUoABRNbPEhLFUFBbwxvBBgVFThdJ0lWFXMBdAgBHRpJRAQAHRoRFw0QABUAGAhJVktYWgQ%3D",
    "gr_user_id": "75cb61af-e446-4f5c-9e68-820aadc004b7",
    "ada35577182650f1_gr_session_id": "73f4409d-1d5b-4541-90e8-002dda6b9b3f",
    "ada35577182650f1_gr_session_id_sent_vst": "73f4409d-1d5b-4541-90e8-002dda6b9b3f",
    "USERINFO": "X1Sv%2B5t8ON63%2F5vWqhal%2FP%2FQ0%2FXSJ3rZvWAoWAXkEubSxm7X2OLF90SMgGPGbe4%2BzfA59DLbasY0dttShLPibt3gBorf9apcBVW9SFEEkCXOrFK2iCJoHhr1Q%2BnK0ANjOI%2Bw9v8D1gef0to2Pyy0Cg%3D%3D",
    "AUTHKEY": "1KlNddkNTxNvUXS9sjPzPwpx%2FziLPqCov2WsIPqfwTb7ZPIPAWpmzBDDbOcR0vFV4z1pEclbUYfEzsEfRJ7NR9BQ0SjPMZI04LWP8yvOZw9HYOOMoJldsg%3D%3D",
    "ada35577182650f1_gr_last_sent_sid_with_cs1": "73f4409d-1d5b-4541-90e8-002dda6b9b3f",
    "ada35577182650f1_gr_last_sent_cs1": "qm26241536966",
    "aso_ucenter": "dd2ffHjrLZ%2Bx258xEAKi8bATcdCxS%2BufmwXuPBewrjrbjLzVIrYx1F4MVoWwCpAQjSM",
    "ada35577182650f1_gr_cs1": "qm26241536966"
}
url = "https://api.qimai.cn/rank/index"
import execjs

with open("13.js", "r", encoding="utf-8") as f:
    js_code = f.read()
    js = execjs.compile(js_code)
    analysis = js.call("get_analysis")

params = {
    "analysis": analysis,
    "brand": "free",
    "device": "iphone",
    "country": "cn",
    "genre": "36",
    "date": "2025-11-06",
    "page": "5",
    "is_rank_index": "1",
    "snapshot": "18:48:12"
}
response = requests.get(url, headers=headers, cookies=cookies, params=params)

print(response.text)
